import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28779
 * Date: 2023-03-11
 * Time: 9:38
 */
public class Test {
    public static int print(int num){
        if(num <= 9){
            return num;
            //System.out.println(num);
        }
        return print(num / 10) + num % 10;
    }
    public static void main(String[] args) {   //打印整数的各位数字
        int ret = print(1729);
        System.out.println(ret);
    }


/*
    public static int sum(int a){
        if(a == 1){
            return 1;
        }
        else{
            return a + sum(a - 1);
        }
    }
    public static void main(String[] args) {  //用递归求1~n的和
        int ret = sum(10);
        System.out.println(ret);
    }
*/

/*    public static void print(int num){
        if(num < 9){
            System.out.println(num);
        }
        else{
            print(num / 10);
            System.out.println(num % 10);
        }
    }
    public static void main(String[] args) {   //打印整数的各位数字
        print(123);
    }*/


/*    public static int max2(int a, int b){
        return (a > b) ? a : b;

    }
    public static int max2(int a, int b, int c){
        int ret = max2(a, b);
        return (ret > c) ? ret : c;
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int ret = max2(a, b);
        int ret2 = max2(a, b, c);
        System.out.println("a和b的最大值是：" + ret);
        System.out.println("a和b和c的最大值是：" + ret2);
    }*/



/*    public static int Fib(int n){
        if(n == 1 || n == 2){
            return 1;
        }
        return Fib(n-1)+Fib(n-2);
    }
    public static void main(String[] args) {   //斐波那锲数列
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int num = Fib(n);
        System.out.println(num);
    }*/


/*    public static int Factorial(int N){
        if(N == 1 || N == 0){
            return 1;
        }
        else {
            return Factorial(N-1)*N;
        }
    }
    public static void main(String[] args) {   //1！+2！+3！+4！+........+n!和的问题
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int sum = 0;
        while(true){

            if(N == 0)
            {
                break;
            }
            int ret = Factorial(N);
            sum += ret;
            N--;
        }
        System.out.println(sum);
    }*/

/*
    public static int Factorial(int N){
        if(N == 1 || N == 0){
            return 1;
        }
        else
        {
            return Factorial(N-1)*N;
        }

    }
    public static void main(String[] args) {   //阶乘问题
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int ret = Factorial(N);
        System.out.println(ret);
    }
*/



/*    public static int max3(int a, int b, int c){
        int ret = max2(a, b);
        return (ret > c) ? ret : c;
    }

    public static int max2(int a, int b){
       return (a > b)? a : b;
    }
    public static void main(String[] args) {     //求最大值问题
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int ret = max2(a, b);
        if(ret == a)
        {
            System.out.println("a和b的最大值是：" + a);
        }else{
            System.out.println("a和b的最大值是：" + b);
        }
        int ret2 = max3(a, b, c);
        if(ret2 == a)
        {
            System.out.println("a和b和c的最大值是：" + b);
        }
        else if(ret2 == b){
            System.out.println("a和b和c的最大值是：" + b);
        }
        else{
            System.out.println("a和b和c的最大值是：" + c);
        }
    }*/


/*    public static void main(String[] args) {
        Scanner scan  = new Scanner(System.in);
        int k = 1;
        while(scan.hasNextInt()){
            int n = scan.nextInt();
            for (int i = 1; i <= n; i++) {
                k = (n - i) + 1;
                for (int j = 1; j <= n; j++) {
                    if(i == j){
                        System.out.print("*");
                    }
                    else if(j == k){
                        System.out.print("*");
                    }
                    else{
                        System.out.print(" ");
                    }
                }
                System.out.println();
            }
        }

    }*/


/*
    public static void main(String[] args) {  //计算1/1-1/2+1/3-1/4+1/5 …… + 1/99 - 1/100 的值 。
        int count = 1;
        float sum = 0;
        for (int i = 1; i <= 100; i++) {
            if(count % 2 == 0){
                sum = sum + (float)1/i;
            }
            if(count % 2 != 0){
                sum = sum - (float)1/i;
            }
            count++;
        }
        System.out.println(sum);
    }
*/


/*
    public static int add(int a, int b){
        return a + b;
    }
    public static double add(double a, double b){
        return a + b;
    }
    public static void main(String[] args) {  //方法的重载
        int a = 2;
        int b = 1;
        int sum1 = add(a, b);
        double s1 = 2.5;
        double s2 = 3.6;
        double sum2 = add(s1, s2);
        System.out.println(sum1+" "+sum2);
    }
*/


/*
    public static int facSum(int s){
        int sum = 0;
        for (int i = 1; i <= s ; i++) {
            int ret = 1;
            for (int j = 1; j <= i ; j++) {
                ret *= j;
            }
            sum += ret;
        }
        return sum;
    }

    public static void main4(String[] args) {    //阶乘(利用函数)
        int sum = facSum(5);
        System.out.println(sum);
    }*/


/*    public static void main3(String[] args) {
        int a = 10;
        int b = 20;
        System.out.println("第一次调用方法之前");
        int ret = add(a, b);
        System.out.println("第一次调用方法之后");
        System.out.println("ret = " + ret);
        System.out.println("第二次调用方法之前");
        ret = add(30, 50);
        System.out.println("第二次调用方法之后");
        System.out.println("ret = " + ret);
    }
    public static int add(int x, int y) {
        System.out.println("调用方法中 x = " + x + " y = " + y);
        return x + y;
    }*/


/*    public static void isLeapYear(int year){
        if(year % 4 ==0 && year % 100 != 0 || year % 400 == 0){
            System.out.println(year + " 是闰年");
        }else{
            System.out.println(year + " 不是闰年");
        }
    }

    public static void main2(String[] args) {   //闰年判断
        int a = 2021;
        isLeapYear(a);
    }*/


/*    public static void main1(String[] args) {
        int input = 5;
        System.out.print("基数：");
        for (int i = 30; i >= 0 ; i -= 2) {
            System.out.print(((input >> i) & 1) + " ");//基数
        }
        System.out.println();
        System.out.print("偶数：");
        for (int j = 31; j >= 1; j -= 2) {
            System.out.print(((input >> j) & 1) + " ");//偶数
        }

    }*/
}
